﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace SupplierRef
{
	[Serializable]
	public partial class SupplierRefModel : UIModel
	{
		#region Constructor
		public SupplierRefModel() : base("SupplierRef")
		{
			InitClass();
			this.SetResourceInfo("ff4eec54-1077-4fc0-bd2b-3071dc9dc428");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private SupplierRefModel(bool isInit) : base("SupplierRef")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new SupplierRefModel(false);
		}
		#endregion
		#region member
		#region views
		private cRefView viewcRef;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public cRefView cRef
		{
			get { return (cRefView)this["cRef"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewcRef = new cRefView(this);
			this.viewcRef.SetResourceInfo("6d2a0c81-ab1d-4076-81e8-7fe44df93508");
			this.Views.Add(this.viewcRef);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.Cust.U9Demo.DeliverUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class cRefView : UIView
	{
		#region Constructor
		public cRefView(IUIModel model) : base(model,"cRef","UFIDA.U9.CBO.SCM.Supplier.Supplier", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private cRefView():base(null,"cRef","UFIDA.U9.CBO.SCM.Supplier.Supplier", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new cRefView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldCode
		{
			get { return this.Fields["Code"]; }
		}
		public IUIField FieldName
		{
			get { return this.Fields["Name"]; }
		}
		public IUIField FieldShortName
		{
			get { return this.Fields["ShortName"]; }
		}
		public IUIField FieldTradeCurrency_ID
		{
			get { return this.Fields["TradeCurrency_ID"]; }
		}
		public IUIField FieldTradeCurrency_Code
		{
			get { return this.Fields["TradeCurrency_Code"]; }
		}
		public IUIField FieldTradeCurrency_Name
		{
			get { return this.Fields["TradeCurrency_Name"]; }
		}
		public IUIField FieldCategory_Code
		{
			get { return this.Fields["Category_Code"]; }
		}
		public IUIField FieldCategory_Name
		{
			get { return this.Fields["Category_Name"]; }
		}
		public IUIField FieldTradeCurrency_PriceRound_Precision
		{
			get { return this.Fields["TradeCurrency_PriceRound_Precision"]; }
		}
		public IUIField FieldTradeCurrency_PriceRound_RoundType
		{
			get { return this.Fields["TradeCurrency_PriceRound_RoundType"]; }
		}
		public IUIField FieldTradeCurrency_PriceRound_RoundValue
		{
			get { return this.Fields["TradeCurrency_PriceRound_RoundValue"]; }
		}
		public IUIField FieldTradeCurrency_MoneyRound_Precision
		{
			get { return this.Fields["TradeCurrency_MoneyRound_Precision"]; }
		}
		public IUIField FieldTradeCurrency_MoneyRound_RoundType
		{
			get { return this.Fields["TradeCurrency_MoneyRound_RoundType"]; }
		}
		public IUIField FieldTradeCurrency_MoneyRound_RoundValue
		{
			get { return this.Fields["TradeCurrency_MoneyRound_RoundValue"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public cRefDefaultFilterFilter DefaultFilter
		{
			get { return (cRefDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","a97b8bd6-bf9e-4705-a823-551023480867");
			UIModelRuntimeFactory.AddNewUIField(this,"Code", typeof(String), false,"","System.String", "Code", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","b483c7dd-c11e-4b4a-b74b-ac3f91ddff1c");
			UIModelRuntimeFactory.AddNewUIField(this,"Name", typeof(String), true,"","System.String", "Name", true,true, false, "",true,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","c9d60ff5-d6c1-4f4c-b85f-cda527e5873d");
			UIModelRuntimeFactory.AddNewUIField(this,"ShortName", typeof(String), true,"","System.String", "ShortName", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","52dda33a-274f-4767-baab-f4d2ef3eb4ec");
			UIModelRuntimeFactory.AddNewUIField(this,"TradeCurrency_ID", typeof(Int64), false,"","System.Int64", "TradeCurrency.ID", false,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","53b8098e-153e-4207-b79b-1a4a8afc8d40");
			UIModelRuntimeFactory.AddNewUIField(this,"TradeCurrency_Code", typeof(String), false,"","System.String", "TradeCurrency.Code", false,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","7608df21-9b29-4cf3-9678-c0febf321db7");
			UIModelRuntimeFactory.AddNewUIField(this,"TradeCurrency_Name", typeof(String), true,"","System.String", "TradeCurrency.Name", false,true, false, "",true,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","208216cd-d189-4d6e-8ed0-48ab7838f91a");
			UIModelRuntimeFactory.AddNewUIField(this,"Category_Code", typeof(String), false,"","System.String", "Category.Code", false,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","9e6b3a08-286a-4183-86d6-9edd24a5a79a");
			UIModelRuntimeFactory.AddNewUIField(this,"Category_Name", typeof(String), true,"","System.String", "Category.Name", false,true, false, "",true,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","c347b9a2-7ad7-40f0-8bd3-c7fa2dae9b5c");
			UIModelRuntimeFactory.AddNewUIField(this,"TradeCurrency_PriceRound_Precision", typeof(Int32), false,"","System.Int32", "TradeCurrency.PriceRound.Precision", false,true, false, "",false,(UIFieldType)1,"d7c6031e-d3fe-41aa-a397-5edd86c10cae","7509755e-d361-41b5-bfea-d3ce1c85e61d");
			UIModelRuntimeFactory.AddNewUIField(this,"TradeCurrency_PriceRound_RoundType", typeof(Int32), false,"","UFIDA.U9.Base.PropertyTypes.RoundTypeEnum", "TradeCurrency.PriceRound.RoundType", false,true, false, "",false,(UIFieldType)2,"fbf427db-9665-4dce-a024-11de74c9beae","f73592d3-8dd3-49cd-a7c8-fadda426ce3b");
			UIModelRuntimeFactory.AddNewUIField(this,"TradeCurrency_PriceRound_RoundValue", typeof(Int32), true,"","System.Int32", "TradeCurrency.PriceRound.RoundValue", false,true, false, "",false,(UIFieldType)1,"d7c6031e-d3fe-41aa-a397-5edd86c10cae","b7703bb8-2243-4252-8914-67ebafdbaf3b");
			UIModelRuntimeFactory.AddNewUIField(this,"TradeCurrency_MoneyRound_Precision", typeof(Int32), false,"","System.Int32", "TradeCurrency.MoneyRound.Precision", false,true, false, "",false,(UIFieldType)1,"d7c6031e-d3fe-41aa-a397-5edd86c10cae","3a341a27-52bb-404c-81d7-db86b02f4300");
			UIModelRuntimeFactory.AddNewUIField(this,"TradeCurrency_MoneyRound_RoundType", typeof(Int32), false,"","UFIDA.U9.Base.PropertyTypes.RoundTypeEnum", "TradeCurrency.MoneyRound.RoundType", false,true, false, "",false,(UIFieldType)2,"fbf427db-9665-4dce-a024-11de74c9beae","fc692f4b-faa4-4d40-9680-c631300cdf68");
			UIModelRuntimeFactory.AddNewUIField(this,"TradeCurrency_MoneyRound_RoundValue", typeof(Int32), true,"","System.Int32", "TradeCurrency.MoneyRound.RoundValue", false,true, false, "",false,(UIFieldType)1,"d7c6031e-d3fe-41aa-a397-5edd86c10cae","b23c93a7-7524-40da-ad8f-235b34eefb3b");


			this.CurrentFilter = new cRefDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region new method
		public new cRefRecord FocusedRecord
		{
			get { return (cRefRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new cRefRecord AddNewUIRecord()
		{	
			return (cRefRecord)base.AddNewUIRecord();
		}
		public new cRefRecord NewUIRecord()
		{	
			return (cRefRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class cRefRecord : UIRecord
	{
		#region Constructor
		public cRefRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private cRefView uiviewcRef
		{
			get { return (cRefView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewcRef.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewcRef.FieldID);
			}
			set{
				this[this.uiviewcRef.FieldID] = value;
			}
		}
		
		
		public  String Code
		{
			get{
				//object value = this[this.uiviewcRef.FieldCode] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldCode);
			}
			set{
				this[this.uiviewcRef.FieldCode] = value;
			}
		}
		
		
		public new String Name
		{
			get{
				//object value = this[this.uiviewcRef.FieldName] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldName);
			}
			set{
				this[this.uiviewcRef.FieldName] = value;
			}
		}
		
		
		public  String ShortName
		{
			get{
				//object value = this[this.uiviewcRef.FieldShortName] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldShortName);
			}
			set{
				this[this.uiviewcRef.FieldShortName] = value;
			}
		}
		
		
		public  Int64 TradeCurrency_ID
		{
			get{
				//object value = this[this.uiviewcRef.FieldTradeCurrency_ID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewcRef.FieldTradeCurrency_ID);
			}
			set{
				this[this.uiviewcRef.FieldTradeCurrency_ID] = value;
			}
		}
		
		
		public  String TradeCurrency_Code
		{
			get{
				//object value = this[this.uiviewcRef.FieldTradeCurrency_Code] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldTradeCurrency_Code);
			}
			set{
				this[this.uiviewcRef.FieldTradeCurrency_Code] = value;
			}
		}
		
		
		public  String TradeCurrency_Name
		{
			get{
				//object value = this[this.uiviewcRef.FieldTradeCurrency_Name] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldTradeCurrency_Name);
			}
			set{
				this[this.uiviewcRef.FieldTradeCurrency_Name] = value;
			}
		}
		
		
		public  String Category_Code
		{
			get{
				//object value = this[this.uiviewcRef.FieldCategory_Code] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldCategory_Code);
			}
			set{
				this[this.uiviewcRef.FieldCategory_Code] = value;
			}
		}
		
		
		public  String Category_Name
		{
			get{
				//object value = this[this.uiviewcRef.FieldCategory_Name] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldCategory_Name);
			}
			set{
				this[this.uiviewcRef.FieldCategory_Name] = value;
			}
		}
		
		
		public  Int32 TradeCurrency_PriceRound_Precision
		{
			get{
				//object value = this[this.uiviewcRef.FieldTradeCurrency_PriceRound_Precision] ;
				//return (Int32)value;
				return GetValue<Int32>(this.uiviewcRef.FieldTradeCurrency_PriceRound_Precision);
			}
			set{
				this[this.uiviewcRef.FieldTradeCurrency_PriceRound_Precision] = value;
			}
		}
		
		
		public  Int32 TradeCurrency_PriceRound_RoundType
		{
			get{
				//object value = this[this.uiviewcRef.FieldTradeCurrency_PriceRound_RoundType] ;
				//return (Int32)value;
				return GetValue<Int32>(this.uiviewcRef.FieldTradeCurrency_PriceRound_RoundType);
			}
			set{
				this[this.uiviewcRef.FieldTradeCurrency_PriceRound_RoundType] = value;
			}
		}
		
		
		public  Int32? TradeCurrency_PriceRound_RoundValue
		{
			get{
				//object value = this[this.uiviewcRef.FieldTradeCurrency_PriceRound_RoundValue] ;
				//return (Int32?)value;
				return GetValue<Int32?>(this.uiviewcRef.FieldTradeCurrency_PriceRound_RoundValue);
			}
			set{
				this[this.uiviewcRef.FieldTradeCurrency_PriceRound_RoundValue] = value;
			}
		}
		
		
		public  Int32 TradeCurrency_MoneyRound_Precision
		{
			get{
				//object value = this[this.uiviewcRef.FieldTradeCurrency_MoneyRound_Precision] ;
				//return (Int32)value;
				return GetValue<Int32>(this.uiviewcRef.FieldTradeCurrency_MoneyRound_Precision);
			}
			set{
				this[this.uiviewcRef.FieldTradeCurrency_MoneyRound_Precision] = value;
			}
		}
		
		
		public  Int32 TradeCurrency_MoneyRound_RoundType
		{
			get{
				//object value = this[this.uiviewcRef.FieldTradeCurrency_MoneyRound_RoundType] ;
				//return (Int32)value;
				return GetValue<Int32>(this.uiviewcRef.FieldTradeCurrency_MoneyRound_RoundType);
			}
			set{
				this[this.uiviewcRef.FieldTradeCurrency_MoneyRound_RoundType] = value;
			}
		}
		
		
		public  Int32? TradeCurrency_MoneyRound_RoundValue
		{
			get{
				//object value = this[this.uiviewcRef.FieldTradeCurrency_MoneyRound_RoundValue] ;
				//return (Int32?)value;
				return GetValue<Int32?>(this.uiviewcRef.FieldTradeCurrency_MoneyRound_RoundValue);
			}
			set{
				this[this.uiviewcRef.FieldTradeCurrency_MoneyRound_RoundValue] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class cRefDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public cRefDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"Org.ID=#Context.OrgID#",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private cRefDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new cRefDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}